<script setup lang="ts">
import { useRedPackStore } from "@/store/redpack";
import { storeToRefs } from "pinia";

const redPackStore = useRedPackStore();
const { redpackInfo } = storeToRefs(redPackStore);

const onBack = () => {
  uni.navigateBack();
};
</script>

<template>
  <view class="header">
    <image
      src="https://wealth-1311286543.cos.ap-guangzhou.myqcloud.com/static/icon_back-arrow.png"
      class="icon-back"
      @click="onBack"
    />
  </view>
  <Flex>
    <image src="https://wealth-1311286543.cos.ap-guangzhou.myqcloud.com/taoshe/static/shop/Ellipse232.png" class="avatar" />
    <text class="name">只能AI导购发出的红包</text>
  </Flex>
  <view class="text">恭喜发财，大吉大利</view>
  <Flex class="count" align="flex-end">
    {{ redpackInfo.count }}
    <text class="suffix">元</text>
  </Flex>
</template>

<style lang="scss" scoped>
.icon-back {
  width: 24px;
  height: 24px;
}
.text {
  color: #999999;
  font-size: 12px;
  text-align: center;
  margin-top: 20px;
}
.avatar {
  width: 30px;
  height: 30px;
  margin-right: 10px;
}
.name {
  color: #222222;
  font-size: 16px;
  font-weight: 400;
}
.header {
  width: 100%;
  height: 150px;
  background-image: url("https://wealth-1311286543.cos.ap-guangzhou.myqcloud.com/static/head-bg.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  margin-bottom: 43px;
  box-sizing: border-box;
  padding: 20px;
}
.count {
  color: #e58335;
  font-size: 33px;
  font-weight: 400;
  margin-top: 30px;
  .suffix {
    font-size: 16px;
    margin-bottom: 7px;
  }
}
</style>
